package com.shigen.demo.base;

/**
 * ThreadLocalMap
 *
 * @author shigenfu
 * @date 2022/5/18 10:19 下午
 */
public class ThreadLocalMap {

  private ThreadLocal<String> name;

  public void getName() {
    System.out.println(this.name.get());
    name.remove();
  }

  public void setName() {
    this.name.set("shigen");
  }

  public static void main(String[] args) {
    ThreadLocalMap localMap = new ThreadLocalMap();
    localMap.setName();
    localMap.getName();

  }
 }
